package com.yuanmei.model;

import com.yuanmei.model.TickQuote;

import java.util.ArrayList;
import java.util.List;

public class PriceStat {
    private float amount;
    private float price;
    private float amountPct;
    private int quoteCount;

    private List<TickQuote> mDetailQuoteList;
    private float mPropertyAmount;

    public PriceStat(float price, float amount) {
        this.price = price;
        this.amount = amount;
        this.amountPct = 0;
        this.quoteCount = 1;
        this.mDetailQuoteList = new ArrayList<>();
        this.mPropertyAmount = 0;
    }

    public float getAmount() {
        return amount;
    }

    public void setAmount(float amount) {
        this.amount = amount;
    }

    public float getAmountPct() {
        return amountPct;
    }

    public void setAmountPct(float amountPct) {
        this.amountPct = amountPct;
    }

    public void incQuoteCount() {
        this.quoteCount++;
    }

    public int getCount() {
        return quoteCount;
    }

    public float getPrice() {
        return price;
    }
    public void setPrice(float price) {
        this.price = price;
    }

    public void addQuoteToDetailList(TickQuote quote) {
        mDetailQuoteList.add(quote);
        if (quote.getType().equalsIgnoreCase("买盘")) {
            this.mPropertyAmount += quote.getAmount();
        } else {
            this.mPropertyAmount -= quote.getAmount();
        }
    }

    public List<TickQuote> getDetailQuoteList() {
        return mDetailQuoteList;
    }

    public float getPropertyAmount() {
        return mPropertyAmount;
    }

//    @Override
//    public int compareTo(@NonNull PriceStat other) {
//        // 排倒序，量大的在前面
//        return  Float.compare(other.amount, this.amount);
//    }
}
